<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8" name="referrer" content="no-referrer">
    <title>MyHub</title>
    <link th:href="@{/css/bootstrap.css}" rel="stylesheet">
    <link th:href="@{/css/bootstrap-theme.css}" rel="stylesheet">
    <link th:href="@{/css/profile.css}" rel="stylesheet">
    <script src="/js/jquery-3.4.1.min.js"></script>
    <script src="/js/bootstrap.min.js"></script>
    <script th:src="@{/js/myhub.js}"></script>
    <script>
        window.onload = function() {
            isLogin();
            flex();
        }
    </script>
</head>
<body>
<!--插入头部导航栏-->
<div th:replace="~{common/commons::topbar}"></div>
<div class="container-fluid main">
<div class="row profile_body">
    <div class="col-lg-9 col-md-12 col-sm-12" id="main">
        <div><h2>发现 <span class="glyphicon glyphicon-list"></span></h2></div>
        <hr>
        <div class="media" th:each="que:${quez.questions}">
            <div>
                <a th:href="@{'/question/'+${que.id}}"><h4 class="media-heading" th:text="${que.title}"></h4></a>
                 <!--<div class="content-modify">
                    <div>编辑</div>
                    <div>删除</div>
                </div>-->
            </div>
            <div class="media-left" >
                <a th:href="@{'/index?userId='+${que.creator}}">
                    <img class="media-object"  alt="xx"
                         th:src="${que.user.avatarUrl}!=null?${que.user.avatarUrl}:'/images/default.png'">
                </a>
            </div>
            <div class="media-body">
                <span th:text="${que.user.name}"></span><span class="text-desc">创建于
                <span th:text="${#dates.format(que.gmtModify,'yyy-MM-dd')}"></span>
                <span th:text="${que.commentCount}"></span>个回复
                <span th:text="${que.viewCount}"></span>次浏览</span>
            </div>
        </div>
        <div th:if="${quez.page==quez.pageCount}">
            <h2 style="font-weight: 1">没有更多了</h2>
        </div>
        <nav aria-label="Page navigation ">
            <ul class="pagination">
                <li><a th:if="${quez.showFirst}" th:href="@{'/index/1'+ ${userId !=null ? '?userId='+userId: ''}}">
                    <span aria-hidden="true">首页</span></a>
                </li>
                <li><a th:if="${quez.showPrevious}" th:href="@{'/index/'+${quez.page - 1}+ ${userId !=null ? '?userId='+userId: ''}}">
                    <span>&laquo;</span>
                </a></li>
                <li th:each="page:${quez.pages}" th:class="${page==quez.page?'active':''}">
                    <a th:href="@{'/index/'+${page} + ${userId !=null ? '?userId='+userId: ''} }" th:text="${page}" ></a></li>
                <li>
                    <a th:if="${quez.showNext}" th:href="@{'/index/'+${quez.page+1} + ${userId !=null ? '?userId='+userId: ''}}" >
                        <span>&raquo;</span>
                    </a>
                </li>
                <li>
                    <a th:if="${quez.showLast}" th:href="@{'/index/'+${quez.pageCount} + ${userId !=null ? '?userId='+userId: ''}}">
                        <span aria-hidden="true">尾页</span>
                    </a>
                </li>
            </ul>
        </nav>
    </div>
    <div class="col-lg-3 col-md-12 col-sm-12 col-xs-12">
        <div style="height: 75px"></div>
        <div th:replace="~{common/commons::sidebar}"></div>
    </div>
</div>
</div>
<!--插入底边信息栏-->
<div th:replace="~{common/commons::foot}"></div>
</body>
</html>
